#include <stdio.h>
#include <gtk/gtk.h>
#include "common.h"

GdkPixbuf *create_pixbuf(gchar *filepath)
{
		GdkPixbuf *pixbuf;
		GError *error = NULL;
		pixbuf = gdk_pixbuf_new_from_file(filepath,&error);
		if(!pixbuf)
		{
				g_print("%s\n",error->message);
				g_error_free(error);
		}
		return pixbuf;
}

GtkWidget *create_image_box(gchar *filepath,int box_type)
{
		GtkWidget *box;
		GtkWidget *image;
								
		if(box_type)
		{
				box = gtk_hbox_new(FALSE,0);
		}
		else
		{
				box = gtk_vbox_new(FALSE,0);
		}

		image = gtk_image_new_from_file(filepath);
		
		gtk_box_pack_start(GTK_BOX(box),image,FALSE,FALSE,0);
	
		gtk_widget_show(image);
		
		return box;
}

